package com.example.mobile2030606148tdh0415;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
private RecyclerView rvMainUser;
private List<Users> list=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list.add(new Users(1,"张三",20,90));
        list.add(new Users(2,"李四",25,80));
        rvMainUser.setAdapter(new UsersRViewAdapter(list));
    }
    private void initView(){
        rvMainUser=(RecyclerView)findViewById(R.id.rvMainUser);
        rvMainUser.setLayoutManager(new LinearLayoutManager(this));
    }

}